home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7451 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  903 b 

  1. Path: prairienet.org!sjmccaug
  2. From: sjmccaug@prairienet.org (Scott J. McCaughrin)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Getting the Program Name
  5. Date: 23 Feb 1996 11:29:07 GMT
  6. Organization: University of Illinois at Urbana
  7. Message-ID: <4gk8e3$om8@vixen.cso.uiuc.edu>
  8. Reply-To: sjmccaug@prairienet.org (Scott J. McCaughrin)
  9. NNTP-Posting-Host: firefly.prairienet.org
  10.  
  11.  
  12.  In a previous post was a query re: retrieving the program's name. Not sure
  13.  if C++ does this, but in C, c0.asm does some initializing, then setargv.asm
  14.  actually sets argv[0] to the program name. If you run 'debug' on any .COM
  15.  and dump CS:002C, you will get the segment address of the environment. If
  16.  you then dump that, with 0 offset: (env_seg:0000) and browse through the
  17.  environment strings, you will eventually come upon the program name. This
  18.  works for DOS 3+ according to the listing for setargv.asm.
  19.  
  20.  Wendy E. McCaughrin
  21.  
  22.